//星期几充电人数

package homework.newenergycharging.Work01.Mapper;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import java.io.IOException;

public class Work01_Mapper extends Mapper<LongWritable, Text, Text, LongWritable>{
    private final Text outKey = new Text();
    private final LongWritable outValue = new LongWritable(1);
    @Override
    protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, Text, LongWritable>.Context context) throws IOException, InterruptedException {
//1366563,7.78,0.0,2014-11-18 15:40:26,2014-11-18 17:11:04,15,17,1.510555556,Tue,android,35897499,582873,461655,0,3,0,1,0,0,0,0,0
        String[] keys = value.toString().split(",");
        outKey.set(keys[8]);
        context.write(outKey, outValue);
    }
}
